<template>
  <div class="top_div" style="gap: 12px">
    <template v-for="item in data.data">
      <div class="player_top_box">
        <n-space style="gap: 2px">
          <img
            style="width: 35px"
            :src="cfg.function.ava(icon)"
            v-for="icon in item.i?.split(',')"
          />
        </n-space>
        <br />
        {{ item.m }} {{ item.b
        }}<template v-if="data.season <= 2000"> Lv.{{ item.l }} ({{ item.r }})</template>

        <n-hr />
        伤害 {{ item.d }}
        <template v-if="data.season <= 2000"
          >（<template v-if="item.t == 'end'">收尾刀</template>
          <template v-else-if="item.t == 'bc'">补偿刀</template>
          <template v-else-if="item.t == 'no'">完整刀</template>）</template
        >
      </div>
    </template>
  </div>
</template>

<script>
import { cfg } from "@/cfg/cfg.js";

export default {
  props: {
    val: {
      required: true,
    },
    ct: {
      required: true,
    },
  },
  setup(props) {
    const ct = props.ct;
    const val = props.val;
    const data = val.player_dao;

    onMounted(async () => {
      const res = await cfg.axios.get(`${cfg.url}`, {
        params: {
          t: "get/auto/gf_user_dao",
          season: data.season,
          uid: data.uid,
          bid: data.bid,
        },
      });
      data.data = res.data.data;
      return;
    });

    return {
      ct,
      val,
      cfg,
      data,
    };
  },
};
</script>
